<?php

namespace app\pc\controller;
use app\base\controller\Base;
use think\Request;
use think\Cache;
use think\Config;
use think\Session;


class Message extends Base
{
    public  $model;

    public function __construct()
    {
   $this->model = model("UsersMessage");
        parent::__construct();

        $rows = Cache::get($this->Cstatic->get("sid"));
        $this->sid_user_id = $rows['id'];
        $this->sid_mobile = $rows['mobile'];
    }


    public function index(){
        //消息销售
        $where['a.user_id'] = $this->sid_user_id;

        //时间的处理
        $res = $this->model->message_page($where);

        $this->model->where(['status'=>0,"user_id"=>$this->sid_user_id])->update(['status'=>1]);

        return   resJson(1,$this->ecLang("query"),$res['res'],$res['pageInfo']);
    }


}
